Skip to content

linuxnc: module init#513364

Open
wucke13 wants to merge 5 commits into
NixOS:masterfrom
wucke13:dev/wucke13/add-linuxcnc
Open

linuxnc: module init#513364
wucke13 wants to merge 5 commits into
NixOS:masterfrom
wucke13:dev/wucke13/add-linuxcnc

Conversation

@wucke13

@wucke13 wucke13 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

This adds a LinuxCNC package and module to NixOS, making NixOS a viable alternative to Debian based distros for CNC machine control. The module and package have been developed for my local hackerspace, and have seen a bit of real world testing with a machine that uses an Ethernet based MESA IO card (MESA 7i76EU).

This addresses #376539 .

@mattywillo I started with your work over on but deviateted quite a bit in a few places. I would appreciate feedback :)

@crabdance & @vetsin you showed interest in this in the past, of course I'm also eager to hear from you what you think.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch 10 times, most recently from 207d3e8 to 53a5e22 Compare April 25, 2026 15:56
@nixpkgs-ci nixpkgs-ci Bot requested review from fgaz and natsukium April 25, 2026 16:02
@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: tcl Dynamic, multi-paradigm programming language 8.has: documentation This PR adds or changes documentation labels Apr 25, 2026
Comment thread pkgs/development/tcl-modules/by-name/bl/blt/package.nix Outdated
Comment thread pkgs/development/tcl-modules/by-name/bl/blt/package.nix Outdated
Comment thread pkgs/development/tcl-modules/by-name/bl/blt/package.nix
@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from 4c8f394 to becbef7 Compare April 25, 2026 18:46
@wucke13

wucke13 commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

@fgaz thank you for the review and the feedback!

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch 2 times, most recently from a4a6b52 to 1663e57 Compare April 26, 2026 17:16
@wucke13

wucke13 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor Author

Discovered further issues with the module:

linux-rt has been removed due to lack of maintenance

Hmmh. Removed from the module. It is not strictly necessary, but obviously useful. If #471091 lands some time, we could add an override of the kernel packages again.

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch 2 times, most recently from 555183d to 6ad141b Compare April 26, 2026 17:29
@wucke13

wucke13 commented May 10, 2026

Copy link
Copy Markdown
Contributor Author

Re-based onto current master.

Also added a patch to make detection of modern PREEMPT_RT kernels (6.12 and newer) work. Said addition is verified using a 6.18 kernel with PREEMPT_RT enabled --- it works.

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from 40fd36f to bea7245 Compare May 14, 2026 10:26
@wucke13

wucke13 commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

Added a fix for the image-to-gcode.py script.

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from bea7245 to f11a3bc Compare May 14, 2026 18:06
@wucke13

wucke13 commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

Added a NixOS test for the module to verify basic functionality of LinuxCNC and auxiliary tools.

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch 2 times, most recently from 229ace1 to a57e4d7 Compare May 16, 2026 23:13
@wucke13

wucke13 commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

Fixed a race condition in the unit test; in particular using xdotool ... --sync now instead of IceWM key-bindings to maximize windows. Refined the screenshot taking to be in total sequence.

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from a57e4d7 to 96078b2 Compare May 19, 2026 21:17
@wucke13

wucke13 commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on master again. Change release notes to 26.11, I'm quite sure that this won't land in 26.05 ...

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 30, 2026
@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from 96078b2 to 0abd193 Compare May 30, 2026 19:58
@wucke13

wucke13 commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current master again.

@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 30, 2026
@wucke13 wucke13 requested a review from fgaz May 30, 2026 20:22
@nixos-discourse

Copy link
Copy Markdown

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/7055

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from 0abd193 to 2765430 Compare June 13, 2026 18:18
Comment thread doc/release-notes/rl-2611.section.md
Comment thread pkgs/development/tcl-modules/by-name/bl/blt/package.nix Outdated
Comment thread pkgs/development/tcl-modules/by-name/bl/blt/package.nix Outdated
Comment thread pkgs/development/tcl-modules/by-name/bl/blt/package.nix Outdated
Comment thread pkgs/development/python-modules/yapps/default.nix
Comment thread pkgs/development/python-modules/yapps/default.nix
Comment thread nixos/modules/programs/linuxcnc.nix Outdated
Comment thread nixos/modules/programs/linuxcnc.nix Outdated
Comment thread nixos/modules/programs/linuxcnc.nix Outdated
Comment thread nixos/modules/programs/linuxcnc.nix Outdated
Comment thread nixos/modules/programs/linuxcnc.nix
@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from 6fed259 to 7c02128 Compare June 13, 2026 22:59
wucke13 and others added 3 commits June 14, 2026 00:59
This is small CLI utility to interface with MESA IO cards for LinuxCNC.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Signed-off-by: wucke13 <wucke13+github@gmail.com>
This is a parser generator required for LinuxCNC to compile.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Signed-off-by: wucke13 <wucke13+github@gmail.com>
This adds TCL BLT, a plotting library which LinuxCNC uses in various
places to provide graphs etc. The original library is long unmaintained
and incompatible with TCL 8.5 and 8.6, but the Debian maintainers
provide a patch series which makes it usable on _modern_ TCL.

Notably, none of the many forks of the original BLT library (see
https://wiki.tcl-lang.org/page/BLT for a list of them) works with
LinuxCNC, only the bespoke original with the Debian patches works.

Co-authored-by: Francesco Gazzetta <fgaz@fgaz.me>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Signed-off-by: wucke13 <wucke13+github@gmail.com>
@wucke13

wucke13 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor Author

@SuperSandro2000 I don't understand how, but some of the suggestions created CRLF to LF errors. Anyhow, thank you for the elaborate review!

@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch 3 times, most recently from d9a1919 to 426cc84 Compare June 13, 2026 23:30
wucke13 and others added 2 commits June 14, 2026 01:41
This adds the LinuxCNC package. The package is quite messy, as LinuxCNC
contains a mixture of GTK, TCL, QT, Python, C and C++ programs and GUI
components.

Most notably, this package has to use an opt-in impure mechanism
for setuid wrappers (using symlinks pointing out of the store into
`/run/wrappers/bin`) as LinuxCNC itself checks if the executables
in LINUXCNC_HOME are setuid wrapped. Notably, as LINUXCNC_HOME is
also used to find assets, we can not just overwrite the environment
variable for the setuid wrapper. But the check also does not verify
$0 to have setuid, but rather `$LINUXCNC_HOME/bin/rtapi_app`.
There is an environment variable supposed to override these checks
(`LINUXCNC_FORCE_REALTIME`), but it doesn't work (upstream issue:
LinuxCNC/linuxcnc#3928)

Also, the _modern_ LinuxCNC GUI (QtDragon) uses an olt qtwebkit severed
by CVEs. As a compromise, this is an opt-in feature. Use needs to
decide for themselves whether they are willing to take the risk of the
associated CVEs.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Signed-off-by: wucke13 <wucke13+github@gmail.com>
Add a LinuxCNC module for real-time control of CNC machines from NixOS.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Signed-off-by: wucke13 <wucke13+github@gmail.com>
@wucke13 wucke13 force-pushed the dev/wucke13/add-linuxcnc branch from 426cc84 to a61763e Compare June 13, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: tcl Dynamic, multi-paradigm programming language 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants